class CreatePositions < ActiveRecord::Migration
  def self.up
    create_table :positions do |t|
      t.integer :airways_id
      t.string :position_code     ,:limit => 6
      t.integer :discount         ,:limit => 1 ,:default => 0
      t.integer :is_locked        ,:limit => 1 ,:default => 0 #是否管理会要锁定 1为True 0为False
      t.timestamps
    end
    
    
    #山航
    Position.create(:airways_id =>1,:position_code=>'Y',:discount=>100)
    Position.create(:airways_id =>1,:position_code=>'B',:discount=>90)
    Position.create(:airways_id =>1,:position_code=>'M',:discount=>85)
    Position.create(:airways_id =>1,:position_code=>'H',:discount=>80)
    Position.create(:airways_id =>1,:position_code=>'K',:discount=>75)
    Position.create(:airways_id =>1,:position_code=>'L',:discount=>70)
    Position.create(:airways_id =>1,:position_code=>'Q',:discount=>60)
    Position.create(:airways_id =>1,:position_code=>'G',:discount=>50)
    Position.create(:airways_id =>1,:position_code=>'V',:discount=>45)
    Position.create(:airways_id =>1,:position_code=>'U',:discount=>40)
    Position.create(:airways_id =>1,:position_code=>'Z',:discount=>35)
    Position.create(:airways_id =>1,:position_code=>'R',:discount=>30)
    Position.create(:airways_id =>1,:position_code=>'W',:discount=>0)
    #国航
    Position.create(:airways_id =>2,:position_code=>'Y',:discount=>100)
    Position.create(:airways_id =>2,:position_code=>'B',:discount=>90)
    Position.create(:airways_id =>2,:position_code=>'M',:discount=>85)
    Position.create(:airways_id =>2,:position_code=>'H',:discount=>80)
    Position.create(:airways_id =>2,:position_code=>'K',:discount=>75)
    Position.create(:airways_id =>2,:position_code=>'L',:discount=>70)
    Position.create(:airways_id =>2,:position_code=>'Q',:discount=>60)
    Position.create(:airways_id =>2,:position_code=>'G',:discount=>50)
    Position.create(:airways_id =>2,:position_code=>'V',:discount=>45)
    Position.create(:airways_id =>2,:position_code=>'U',:discount=>40)
    Position.create(:airways_id =>2,:position_code=>'W',:discount=>0)
    #东航
    Position.create(:airways_id =>3,:position_code=>'Y',:discount=>100)
    Position.create(:airways_id =>3,:position_code=>'B',:discount=>90)
    Position.create(:airways_id =>3,:position_code=>'H',:discount=>80)
    Position.create(:airways_id =>3,:position_code=>'L',:discount=>75)
    Position.create(:airways_id =>3,:position_code=>'M',:discount=>70)
    Position.create(:airways_id =>3,:position_code=>'N',:discount=>65)
    Position.create(:airways_id =>3,:position_code=>'R',:discount=>60)
    Position.create(:airways_id =>3,:position_code=>'V',:discount=>50)
    Position.create(:airways_id =>3,:position_code=>'T',:discount=>45)
    Position.create(:airways_id =>3,:position_code=>'W',:discount=>40)
    Position.create(:airways_id =>3,:position_code=>'X',:discount=>35)
    Position.create(:airways_id =>3,:position_code=>'G',:discount=>30)
    Position.create(:airways_id =>3,:position_code=>'Q',:discount=>0)
    #南航
    Position.create(:airways_id =>4,:position_code=>'Y',:discount=>100)
    Position.create(:airways_id =>4,:position_code=>'T',:discount=>90)
    Position.create(:airways_id =>4,:position_code=>'K',:discount=>85)
    Position.create(:airways_id =>4,:position_code=>'H',:discount=>80)
    Position.create(:airways_id =>4,:position_code=>'M',:discount=>75)
    Position.create(:airways_id =>4,:position_code=>'G',:discount=>70)
    Position.create(:airways_id =>4,:position_code=>'S',:discount=>65)
    Position.create(:airways_id =>4,:position_code=>'L',:discount=>60)
    Position.create(:airways_id =>4,:position_code=>'Q',:discount=>55)
    Position.create(:airways_id =>4,:position_code=>'E',:discount=>50)
    Position.create(:airways_id =>4,:position_code=>'V',:discount=>45)
    Position.create(:airways_id =>4,:position_code=>'W',:discount=>40)
    Position.create(:airways_id =>4,:position_code=>'B',:discount=>0)
    #上航
    Position.create(:airways_id =>5,:position_code=>'Y',:discount=>100)
    Position.create(:airways_id =>5,:position_code=>'B',:discount=>90)
    Position.create(:airways_id =>5,:position_code=>'L',:discount=>80)
    Position.create(:airways_id =>5,:position_code=>'M',:discount=>75)
    Position.create(:airways_id =>5,:position_code=>'T',:discount=>70)
    Position.create(:airways_id =>5,:position_code=>'E',:discount=>65)
    Position.create(:airways_id =>5,:position_code=>'H',:discount=>60)
    Position.create(:airways_id =>5,:position_code=>'Q',:discount=>55)
    Position.create(:airways_id =>5,:position_code=>'V',:discount=>50)
    Position.create(:airways_id =>5,:position_code=>'W',:discount=>40)
    Position.create(:airways_id =>5,:position_code=>'P',:discount=>30)
    Position.create(:airways_id =>5,:position_code=>'G',:discount=>0)
    #厦航
    Position.create(:airways_id =>6,:position_code=>'Y',:discount=>100)
    Position.create(:airways_id =>6,:position_code=>'B',:discount=>90)
    Position.create(:airways_id =>6,:position_code=>'H',:discount=>85)
    Position.create(:airways_id =>6,:position_code=>'K',:discount=>80)
    Position.create(:airways_id =>6,:position_code=>'L',:discount=>75)
    Position.create(:airways_id =>6,:position_code=>'M',:discount=>70)
    Position.create(:airways_id =>6,:position_code=>'N',:discount=>65)
    Position.create(:airways_id =>6,:position_code=>'Q',:discount=>60)
    Position.create(:airways_id =>6,:position_code=>'T',:discount=>55)
    Position.create(:airways_id =>6,:position_code=>'V',:discount=>50)
    Position.create(:airways_id =>6,:position_code=>'X',:discount=>45)
    Position.create(:airways_id =>6,:position_code=>'R',:discount=>40)
    Position.create(:airways_id =>6,:position_code=>'P',:discount=>35)
    Position.create(:airways_id =>6,:position_code=>'U',:discount=>30)
    Position.create(:airways_id =>6,:position_code=>'I',:discount=>0)
    #深航
    Position.create(:airways_id =>7,:position_code=>'Y',:discount=>100)
    Position.create(:airways_id =>7,:position_code=>'G',:discount=>90)
    Position.create(:airways_id =>7,:position_code=>'H',:discount=>80)
    Position.create(:airways_id =>7,:position_code=>'Q',:discount=>70)
    Position.create(:airways_id =>7,:position_code=>'L',:discount=>65)
    Position.create(:airways_id =>7,:position_code=>'S',:discount=>60)
    Position.create(:airways_id =>7,:position_code=>'N',:discount=>55)
    Position.create(:airways_id =>7,:position_code=>'M',:discount=>50)
    Position.create(:airways_id =>7,:position_code=>'E',:discount=>45)
    Position.create(:airways_id =>7,:position_code=>'B',:discount=>40)
    Position.create(:airways_id =>7,:position_code=>'ZVI',:discount=>0)
    #海航
    Position.create(:airways_id =>8,:position_code=>'Y',:discount=>100)
    Position.create(:airways_id =>8,:position_code=>'B',:discount=>90)
    Position.create(:airways_id =>8,:position_code=>'H',:discount=>85)
    Position.create(:airways_id =>8,:position_code=>'K',:discount=>80)
    Position.create(:airways_id =>8,:position_code=>'L',:discount=>75)
    Position.create(:airways_id =>8,:position_code=>'M',:discount=>70)
    Position.create(:airways_id =>8,:position_code=>'N',:discount=>65)
    Position.create(:airways_id =>8,:position_code=>'Q',:discount=>60)
    Position.create(:airways_id =>8,:position_code=>'T',:discount=>55)
    Position.create(:airways_id =>8,:position_code=>'X',:discount=>50)
    Position.create(:airways_id =>8,:position_code=>'U',:discount=>45)
    Position.create(:airways_id =>8,:position_code=>'E',:discount=>40)
    Position.create(:airways_id =>8,:position_code=>'VJ',:discount=>0)
    #川航
    Position.create(:airways_id =>9,:position_code=>'Y',:discount=>100)
    Position.create(:airways_id =>9,:position_code=>'T',:discount=>90)
    Position.create(:airways_id =>9,:position_code=>'K',:discount=>85)
    Position.create(:airways_id =>9,:position_code=>'H',:discount=>80)
    Position.create(:airways_id =>9,:position_code=>'M',:discount=>75)
    Position.create(:airways_id =>9,:position_code=>'G',:discount=>70)
    Position.create(:airways_id =>9,:position_code=>'S',:discount=>65)
    Position.create(:airways_id =>9,:position_code=>'L',:discount=>60)
    Position.create(:airways_id =>9,:position_code=>'Q',:discount=>55)
    Position.create(:airways_id =>9,:position_code=>'E',:discount=>50)
    Position.create(:airways_id =>9,:position_code=>'V',:discount=>45)
    Position.create(:airways_id =>9,:position_code=>'R',:discount=>40)
    Position.create(:airways_id =>9,:position_code=>'J',:discount=>35)
    Position.create(:airways_id =>9,:position_code=>'I',:discount=>30)
    Position.create(:airways_id =>9,:position_code=>'B',:discount=>0)
    #吉祥
    Position.create(:airways_id =>10,:position_code=>'Y',:discount=>100)
    Position.create(:airways_id =>10,:position_code=>'B',:discount=>90)
    Position.create(:airways_id =>10,:position_code=>'L',:discount=>80)
    Position.create(:airways_id =>10,:position_code=>'M',:discount=>75)
    Position.create(:airways_id =>10,:position_code=>'T',:discount=>70)
    Position.create(:airways_id =>10,:position_code=>'E',:discount=>65)
    Position.create(:airways_id =>10,:position_code=>'H',:discount=>60)
    Position.create(:airways_id =>10,:position_code=>'Q',:discount=>55)
    Position.create(:airways_id =>10,:position_code=>'V',:discount=>50)
    Position.create(:airways_id =>10,:position_code=>'X',:discount=>45)
    Position.create(:airways_id =>10,:position_code=>'W',:discount=>40)
    Position.create(:airways_id =>10,:position_code=>'R',:discount=>30)
    Position.create(:airways_id =>10,:position_code=>'G',:discount=>0)
    #奥凯
    Position.create(:airways_id =>11,:position_code=>'Y',:discount=>100)
    Position.create(:airways_id =>11,:position_code=>'B',:discount=>90)
    Position.create(:airways_id =>11,:position_code=>'H',:discount=>85)
    Position.create(:airways_id =>11,:position_code=>'K',:discount=>80)
    Position.create(:airways_id =>11,:position_code=>'M',:discount=>75)
    Position.create(:airways_id =>11,:position_code=>'L',:discount=>70)
    Position.create(:airways_id =>11,:position_code=>'N',:discount=>65)
    Position.create(:airways_id =>11,:position_code=>'Q',:discount=>60)
    Position.create(:airways_id =>11,:position_code=>'T',:discount=>55)
    Position.create(:airways_id =>11,:position_code=>'X',:discount=>50)
    Position.create(:airways_id =>11,:position_code=>'E',:discount=>45)
    Position.create(:airways_id =>11,:position_code=>'U',:discount=>40)
    Position.create(:airways_id =>11,:position_code=>'I',:discount=>0)
    #中联
    Position.create(:airways_id =>12,:position_code=>'Y',:discount=>100)
    Position.create(:airways_id =>12,:position_code=>'H',:discount=>90)
    Position.create(:airways_id =>12,:position_code=>'K',:discount=>85)
    Position.create(:airways_id =>12,:position_code=>'L',:discount=>80)
    Position.create(:airways_id =>12,:position_code=>'M',:discount=>75)
    Position.create(:airways_id =>12,:position_code=>'T',:discount=>70)
    Position.create(:airways_id =>12,:position_code=>'E',:discount=>65)
    Position.create(:airways_id =>12,:position_code=>'V',:discount=>60)
    Position.create(:airways_id =>12,:position_code=>'U',:discount=>55)
    Position.create(:airways_id =>12,:position_code=>'Q',:discount=>50)
    Position.create(:airways_id =>12,:position_code=>'G',:discount=>45)
    Position.create(:airways_id =>12,:position_code=>'B',:discount=>40)
    #东星
    Position.create(:airways_id =>13,:position_code=>'Y',:discount=>100)
    Position.create(:airways_id =>13,:position_code=>'T',:discount=>90)
    Position.create(:airways_id =>13,:position_code=>'K',:discount=>85)
    Position.create(:airways_id =>13,:position_code=>'H',:discount=>80)
    Position.create(:airways_id =>13,:position_code=>'M',:discount=>75)
    Position.create(:airways_id =>13,:position_code=>'G',:discount=>70)
    Position.create(:airways_id =>13,:position_code=>'S',:discount=>65)
    Position.create(:airways_id =>13,:position_code=>'L',:discount=>60)
    Position.create(:airways_id =>13,:position_code=>'Q',:discount=>55)
    Position.create(:airways_id =>13,:position_code=>'E',:discount=>50)
    Position.create(:airways_id =>13,:position_code=>'W',:discount=>45)
    Position.create(:airways_id =>13,:position_code=>'Z',:discount=>40)
    Position.create(:airways_id =>13,:position_code=>'V',:discount=>35)
    Position.create(:airways_id =>13,:position_code=>'X',:discount=>30)
    Position.create(:airways_id =>13,:position_code=>'U',:discount=>0)
    #祥鹏
    Position.create(:airways_id =>14,:position_code=>'Y',:discount=>100)
    Position.create(:airways_id =>14,:position_code=>'B',:discount=>90)
    Position.create(:airways_id =>14,:position_code=>'H',:discount=>85)
    Position.create(:airways_id =>14,:position_code=>'K',:discount=>80)
    Position.create(:airways_id =>14,:position_code=>'L',:discount=>75)
    Position.create(:airways_id =>14,:position_code=>'M',:discount=>70)
    Position.create(:airways_id =>14,:position_code=>'N',:discount=>65)
    Position.create(:airways_id =>14,:position_code=>'Q',:discount=>60)
    Position.create(:airways_id =>14,:position_code=>'T',:discount=>55)
    Position.create(:airways_id =>14,:position_code=>'X',:discount=>50)
    Position.create(:airways_id =>14,:position_code=>'U',:discount=>45)
    Position.create(:airways_id =>14,:position_code=>'E',:discount=>40)
    #鹰联
    Position.create(:airways_id =>15,:position_code=>'Y',:discount=>100)
    Position.create(:airways_id =>15,:position_code=>'B',:discount=>90)
    Position.create(:airways_id =>15,:position_code=>'H',:discount=>85)
    Position.create(:airways_id =>15,:position_code=>'K',:discount=>80)
    Position.create(:airways_id =>15,:position_code=>'L',:discount=>75)
    Position.create(:airways_id =>15,:position_code=>'M',:discount=>70)
    Position.create(:airways_id =>15,:position_code=>'N',:discount=>65)
    Position.create(:airways_id =>15,:position_code=>'Q',:discount=>60)
    Position.create(:airways_id =>15,:position_code=>'T',:discount=>55)
    Position.create(:airways_id =>15,:position_code=>'X',:discount=>50)
    Position.create(:airways_id =>15,:position_code=>'U',:discount=>45)
    Position.create(:airways_id =>15,:position_code=>'E',:discount=>40)
    #西部
    Position.create(:airways_id =>16,:position_code=>'Y',:discount=>100)
    Position.create(:airways_id =>16,:position_code=>'B',:discount=>90)
    Position.create(:airways_id =>16,:position_code=>'H',:discount=>85)
    Position.create(:airways_id =>16,:position_code=>'K',:discount=>80)
    Position.create(:airways_id =>16,:position_code=>'L',:discount=>75)
    Position.create(:airways_id =>16,:position_code=>'M',:discount=>70)
    Position.create(:airways_id =>16,:position_code=>'N',:discount=>65)
    Position.create(:airways_id =>16,:position_code=>'Q',:discount=>60)
    Position.create(:airways_id =>16,:position_code=>'T',:discount=>55)
    Position.create(:airways_id =>16,:position_code=>'X',:discount=>50)
    Position.create(:airways_id =>16,:position_code=>'U',:discount=>45)
    Position.create(:airways_id =>16,:position_code=>'E',:discount=>40)
    #华夏
    Position.create(:airways_id =>17,:position_code=>'Y',:discount=>100)
    Position.create(:airways_id =>17,:position_code=>'T',:discount=>90)
    Position.create(:airways_id =>17,:position_code=>'K',:discount=>85)
    Position.create(:airways_id =>17,:position_code=>'H',:discount=>80)
    Position.create(:airways_id =>17,:position_code=>'M',:discount=>75)
    Position.create(:airways_id =>17,:position_code=>'G',:discount=>70)
    Position.create(:airways_id =>17,:position_code=>'S',:discount=>65)
    Position.create(:airways_id =>17,:position_code=>'L',:discount=>60)
    Position.create(:airways_id =>17,:position_code=>'Q',:discount=>55)
    Position.create(:airways_id =>17,:position_code=>'E',:discount=>50)
    Position.create(:airways_id =>17,:position_code=>'V',:discount=>45)
    Position.create(:airways_id =>17,:position_code=>'R',:discount=>40)
    Position.create(:airways_id =>17,:position_code=>'U',:discount=>35)
    Position.create(:airways_id =>17,:position_code=>'X',:discount=>30)
    Position.create(:airways_id =>17,:position_code=>'W',:discount=>0)
    #快运
    Position.create(:airways_id =>18,:position_code=>'Y',:discount=>100)
    Position.create(:airways_id =>18,:position_code=>'B',:discount=>90)
    Position.create(:airways_id =>18,:position_code=>'H',:discount=>85)
    Position.create(:airways_id =>18,:position_code=>'K',:discount=>80)
    Position.create(:airways_id =>18,:position_code=>'L',:discount=>75)
    Position.create(:airways_id =>18,:position_code=>'M',:discount=>70)
    Position.create(:airways_id =>18,:position_code=>'N',:discount=>65)
    Position.create(:airways_id =>18,:position_code=>'Q',:discount=>60)
    Position.create(:airways_id =>18,:position_code=>'T',:discount=>55)
    Position.create(:airways_id =>18,:position_code=>'X',:discount=>50)
    Position.create(:airways_id =>18,:position_code=>'U',:discount=>45)
    Position.create(:airways_id =>18,:position_code=>'E',:discount=>40)
    Position.create(:airways_id =>18,:position_code=>'VJ',:discount=>0)
    #东北
    Position.create(:airways_id =>19,:position_code=>'Y',:discount=>100)
    Position.create(:airways_id =>19,:position_code=>'T',:discount=>90)
    Position.create(:airways_id =>19,:position_code=>'K',:discount=>85)
    Position.create(:airways_id =>19,:position_code=>'H',:discount=>80)
    Position.create(:airways_id =>19,:position_code=>'M',:discount=>75)
    Position.create(:airways_id =>19,:position_code=>'G',:discount=>70)
    Position.create(:airways_id =>19,:position_code=>'S',:discount=>65)
    Position.create(:airways_id =>19,:position_code=>'L',:discount=>60)
    Position.create(:airways_id =>19,:position_code=>'Q',:discount=>55)
    Position.create(:airways_id =>19,:position_code=>'E',:discount=>50)
    Position.create(:airways_id =>19,:position_code=>'V',:discount=>45)
    Position.create(:airways_id =>19,:position_code=>'R',:discount=>40)
  end
  
  def self.down
    drop_table :positions
  end
end
